﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;
using Project.Engine.Utilities;
using Project.Module.DAO.BL;
using System.Web.SessionState;

namespace Project.Module.Controller
{
    public class CartController
    {
    }

    public partial class HomeController {
        public ActionResult DeleteCart(string username, int idCart)
        {
            (new CartBL()).DeleteCart(username, idCart);
            return Redirect("/gio-hang?name=" + username);
        }

        public ActionResult BuyCart(string username, int idCart)
        {
            (new CartBL()).BuyCart(username, idCart);
            return View("/Views/Home/ThanhCong.cshtml");//mua hang thanh cong 
        }

        public ActionResult AddCart(string username, int idProduct)
        {
            (new CartBL()).AddCart(username, idProduct);
            return Redirect("/gio-hang?name=" + username);
        }

        public ActionResult DeleteCartInCMS(int idCart) {
            (new CartBL()).DeleteCartInCMS(idCart);
            return Redirect("/admin/quan-ly-dat-hang");
        }
        public ActionResult ChitietInCMS(int idCart)
        {
            (new CartBL()).ChitietInCMS(idCart);
            return Redirect("/admin/quan-ly-dat-hang");
        }

    }
}
